package cn.bytengine.stem.sdso;

public abstract class AbstractClusterHost implements ClusterHost {

    private String localAddress;

    private int port;

    private String hostId;

    protected AbstractClusterHost() {

    }

    protected AbstractClusterHost(String localAddress, int port) {
        this.localAddress = localAddress;
        this.port = port;
    }

    protected AbstractClusterHost(String localAddress, int port, String hostId) {
        this.localAddress = localAddress;
        this.port = port;
        this.hostId = hostId;
    }

    protected void setLocalAddress(String localAddress) {
        this.localAddress = localAddress;
    }

    protected void setPort(int port) {
        this.port = port;
    }

    public void setHostId(String hostId) {
        this.hostId = hostId;
    }

    @Override
    public String getIPAddress() {
        return localAddress;
    }

    @Override
    public int getPort() {
        return port;
    }

    @Override
    public String getHostId() {
        return hostId;
    }
}
